<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .cart {
            width: 100px;
            height: 40px;
            background-color: #ddd;
            float: right;
            text-align: center;
            line-height: 40px;
        }

        .cart a {
            display: block;
        }

        .hide {
            width: 200px;
            height: 50px;
            background-color: #f00;
            position: absolute;
            right: 0;
            top: 40px;

            height: 0;
            overflow: hidden;
            transition: .3s;
        }

        .cart:hover .hide {
            height: 50px;
        }
    </style>
</head>

<body>
    <div class="cart">
        <a href="">购物车</a>
        <div class="hide"></div>
    </div>
</body>

</html>